🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / feature / node / src / jvmTest / kotlin / org / meshtastic / feature / node / metrics / ExportLocaleInvarianceTest.kt
Displaying Raw • Download
feature/node/src/jvmTest/kotlin/org/meshtastic/feature/node/metrics/ExportLocaleInvarianceTest.kt renovate/fastlane-2.x-lockfile (056eed64) Text, 1.93 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.feature.node.metrics
Tff7b72import T7ee787org.meshtastic.proto.Position
Tff7b72import T7ee787java.util.Locale
Tff7b72import T7ee787kotlin.test.AfterTest
Tff7b72import T7ee787kotlin.test.Test
Tff7b72import T7ee787kotlin.test.assertFalse
Tff7b72import T7ee787kotlin.test.assertTrue
T8b949e/**
* Display formatting follows the OS locale, but a GPX file does not: it is XML another program parses, and
* `lat="52,5200000"` is a file no importer accepts. This pins that boundary from the wrong side of it — a comma locale
* — because the failure is silent, happens off-device, and surfaces only when a user's import fails.
*/
Tff7b72class T56d364ExportLocaleInvarianceTest Tb4b4b4{
Tff7b72private Tff7b72val Te6edf3originalLocaleTb4b4b4: Te6edf3Locale Tff7b72= Te6edf3LocaleTb4b4b4.Te6edf3getDefaultTb4b4b4(Tb4b4b4)
Tf0883e@AfterTest
Tff7b72fun Td2a8fftearDownTb4b4b4(Tb4b4b4) Tb4b4b4{
Te6edf3LocaleTb4b4b4.Te6edf3setDefaultTb4b4b4(Te6edf3originalLocaleTb4b4b4)
Tb4b4b4}
Tf0883e@Test
Tff7b72fun Td2a8ff`gpx coordinates keep a dot separator on a comma locale`Tb4b4b4(Tb4b4b4) Tb4b4b4{
Te6edf3LocaleTb4b4b4.Te6edf3setDefaultTb4b4b4(Te6edf3LocaleTb4b4b4.Te6edf3GERMANYTb4b4b4)
Tff7b72val Te6edf3gpx Tff7b72= Te6edf3buildGpxTb4b4b4(Te6edf3listOfTb4b4b4(Te6edf3PositionTb4b4b4(Te6edf3latitude_i Tff7b72= T79c0ff5T79c0ff2T79c0ff5Te6edf3_200_000Tb4b4b4, Te6edf3longitude_i Tff7b72= T79c0ff1T79c0ff3T79c0ff4Te6edf3_050_000Tb4b4b4)Tb4b4b4)Tb4b4b4, Ta5d6ff"Ta5d6ffBerlinTa5d6ff"Tb4b4b4)
Te6edf3assertTrueTb4b4b4(Te6edf3gpxTb4b4b4.Te6edf3containsTb4b4b4(Ta5d6ff"Ta5d6fflat=Ta5d6ff\"Ta5d6ff52.52Ta5d6ff"Tb4b4b4)Tb4b4b4, Ta5d6ff"Ta5d6fflatitude was localized:Ta5d6ff\Ta5d6ffnTffd700$Te6edf3gpxTa5d6ff"Tb4b4b4)
Te6edf3assertTrueTb4b4b4(Te6edf3gpxTb4b4b4.Te6edf3containsTb4b4b4(Ta5d6ff"Ta5d6fflon=Ta5d6ff\"Ta5d6ff13.40Ta5d6ff"Tb4b4b4)Tb4b4b4, Ta5d6ff"Ta5d6fflongitude was localized:Ta5d6ff\Ta5d6ffnTffd700$Te6edf3gpxTa5d6ff"Tb4b4b4)
Te6edf3assertFalseTb4b4b4(Te6edf3gpxTb4b4b4.Te6edf3containsTb4b4b4(Ta5d6ff"Ta5d6ff52,52Ta5d6ff"Tb4b4b4)Tb4b4b4, Ta5d6ff"Ta5d6fflatitude used a comma decimal:Ta5d6ff\Ta5d6ffnTffd700$Te6edf3gpxTa5d6ff"Tb4b4b4)
Tb4b4b4}
Tb4b4b4}
Served by rngit 1.5.2 - Generated in 0.21s